<style lang="scss">

</style>
<template>

</template>

<script>
import { pageMixin } from '@/mixins'
import { GetQueryByString } from '@/common/helper'
import { linkToEasy, modal } from '@/common/fun'

export default {
  mixins: [pageMixin],
  data () {
    return {

    }
  },
  methods: {
    async _init_func () {

    }
  },
  onLoad (options) {
    var e = options

    if (e.q) {
      var url = decodeURIComponent(e.q) // 使用decodeURIComponent解析  获取当前二维码的网址
      console.log(url)
      var channel = GetQueryByString(url, 'channel')
      console.log(channel)

      var id = null; var path = null
      switch (channel) {
        case 'voice':
          path = '/pages/voice/map?id=' + GetQueryByString(url, 'scene')
          break
        case 'scene':
          path = '/pages/scene/detail?id=' + GetQueryByString(url, 'id')
          break
        case 'sceneitem':
          path = '/pages/voice/item?id=' + GetQueryByString(url, 'item')
          break
        case 'city':
          path = '/pages/city/detail?id=' + GetQueryByString(url, 'id')
          break
        case 'worker':
          path = '/pages/worker/detail?id=' + GetQueryByString(url, 'id')
          break
        case 'town':
          path = '/pages/town/detail?id=' + GetQueryByString(url, 'id')
          break
        case 'village':
          path = '/pages/village/detail?id=' + GetQueryByString(url, 'id')
          break
        case 'pano':
          path = '/pages/pano/detail?id=' + GetQueryByString(url, 'id')
          break
        case 'goods':
          path = '/pages/goods/goods?id=' + GetQueryByString(url, 'id')
          break
        default:
          modal('未知类型')
          break
      }

      linkToEasy(path)
    }
  }
}

</script>
